package com.info.zhiduoduo.pay.sdk.zhaoshangbank.model.request.tradebulter.detail;

import com.google.common.collect.Lists;
import com.info.zhiduoduo.pay.formbean.zhaoshangtradebulter.QuerySubLedgerHistoryTradeFormBean;

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class QuerySubLedgerHistoryTradeInfo {

	/** 账号 */
	private String accnbr;

	/** 记账子单元编号: 填空表示查询该账号下所有记账子单元信息 */
	private String dmanbr;

	/** 只能查询近 13 个月的历史交易 */
	private String begdat;

	/** 小于当天，大于或等于起始日期，与起始日期相距100天内 */
	private String enddat;

	/** 续传字段: 第一次传空，当返回接口有本接口并且该接口的续传字段有值，说明需要续传，取出续传字段放到下次请求报文中继续查询 */
	private String ctnkey;

	public static List<QuerySubLedgerHistoryTradeInfo> ofList(QuerySubLedgerHistoryTradeFormBean formBean) {
		List<QuerySubLedgerHistoryTradeInfo> list = Lists.newArrayList();
		QuerySubLedgerHistoryTradeInfo info = new QuerySubLedgerHistoryTradeInfo().setAccnbr(formBean.getAccountNo())
				.setDmanbr(formBean.getLedgerNo())
				.setBegdat(formBean.getBegdat())
				.setEnddat(formBean.getEnddat())
				.setCtnkey(formBean.getCtnkey());
		list.add(info);
		return list;
	}
}
